package com.xjl.everyinterview.jvm;



/**
 * @author xjl
 * @version 1.0
 * @description: 测试classloader的加载方式
 * 1 bootstrap
 * 2 exc or platform
 * 3 app
 * 4 user
 * @date 2021/8/23 19:35
 */
public class ClassLoader {
    public static void main(String[] args) throws ClassNotFoundException {
        System.out.println("load class loader");
        Class<?> driver = Class.forName("java.sql.Driver");
        System.out.println(driver.getClassLoader());
        ClassLoader classLoader = new ClassLoader();
        System.out.println(classLoader.getClass().getClassLoader());
        System.out.println(classLoader.getClass().getClassLoader().getParent().getClass().getClassLoader());
    }
}
